package com.hnluchuan.bmjlearning.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.hnluchuan.core.model.BaseModel;

import com.hnluchuan.bmjlearning.model.Agent;
import javax.persistence.ManyToOne;
import java.util.Date;
import com.hnluchuan.bmjlearning.model.User;
import javax.persistence.JoinColumn;
import javax.persistence.FetchType;
import com.hnluchuan.bmjlearning.model.Province;
import org.springframework.format.annotation.DateTimeFormat;
import com.hnluchuan.bmjlearning.model.City;
import com.hnluchuan.bmjlearning.model.District;

/**
 * 客户
 */
@Entity
@Table(name = "t_customer") 
public class Customer extends BaseModel {
	private static final long serialVersionUID = 1L;
	
	public Customer() {
	}
	
	public Customer(Long id) {
		this.id = id;
	}
	
	/**
	 * id
	 */
	@Id
	@GeneratedValue
	@Column(name = "id")
	private Long id;
	/**
	 * 用户
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	private User user;
	/**
	 * 0禁用，1启用
	 */
	@Column(name = "status")    		
	private Integer status;
	/**
	 * 机构名称
	 */
	@Column(name = "org_name")    		
	private String orgName;
	/**
	 * 客户名称
	 */
	@Column(name = "name")    		
	private String name;
	/**
	 * 到期时间
	 */
	@DateTimeFormat(pattern = "")
	@Column(name = "expire_date")
	private Date expireDate;
	/**
	 * 身份证
	 */
	@Column(name = "id_card")    		
	private String idCard;
	/**
	 * 手机号码
	 */
	@Column(name = "mobile")    		
	private String mobile;
	/**
	 * 客户职称
	 */
	@Column(name = "title")    		
	private String title;
	/**
	 * 省
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "province_id")
	private Province province;
	/**
	 * 市
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "city_id")
	private City city;
	/**
	 * 区县
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "district_id")
	private District district;
	/**
	 * address
	 */
	@Column(name = "address")    		
	private String address;
	/**
	 * 性别
	 */
	@Column(name = "sex")    		
	private Integer sex;
	/**
	 * 所属代理商
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "agent_id")
	private Agent agent;
	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern = "")
	@Column(name = "created")
	private Date created;
	/**
	 * 用户类型
	 */
	@Column(name = "type")
	private Integer type;
	// fields end
	
	/** id */
	public Long getId() {
    	return id;
    }
    /** id */
    public void setId(Long id) {
    	this.id = id;
    }
	/** 用户 */
	public User getUser() {
    	return user;
    }
    /** 用户 */
    public void setUser(User user) {
    	this.user = user;
    }
	/** 0禁用，1启用 */
	public Integer getStatus() {
    	return status;
    }
    /** 0禁用，1启用 */
    public void setStatus(Integer status) {
    	this.status = status;
    }
	/** 机构名称 */
	public String getOrgName() {
    	return orgName;
    }
    /** 机构名称 */
    public void setOrgName(String orgName) {
    	this.orgName = orgName;
    }
	/** 客户名称 */
	public String getName() {
    	return name;
    }
    /** 客户名称 */
    public void setName(String name) {
    	this.name = name;
    }
	/** 到期时间 */
	public Date getExpireDate() {
    	return expireDate;
    }
    /** 到期时间 */
    public void setExpireDate(Date expireDate) {
    	this.expireDate = expireDate;
    }
	/** 身份证 */
	public String getIdCard() {
    	return idCard;
    }
    /** 身份证 */
    public void setIdCard(String idCard) {
    	this.idCard = idCard;
    }
	/** 手机号码 */
	public String getMobile() {
    	return mobile;
    }
    /** 手机号码 */
    public void setMobile(String mobile) {
    	this.mobile = mobile;
    }
	/** 客户职称 */
	public String getTitle() {
    	return title;
    }
    /** 客户职称 */
    public void setTitle(String title) {
    	this.title = title;
    }
	/** 省 */
	public Province getProvince() {
    	return province;
    }
    /** 省 */
    public void setProvince(Province province) {
    	this.province = province;
    }
	/** 市 */
	public City getCity() {
    	return city;
    }
    /** 市 */
    public void setCity(City city) {
    	this.city = city;
    }
	/** 区县 */
	public District getDistrict() {
    	return district;
    }
    /** 区县 */
    public void setDistrict(District district) {
    	this.district = district;
    }
	/** address */
	public String getAddress() {
    	return address;
    }
    /** address */
    public void setAddress(String address) {
    	this.address = address;
    }
	/** 性别 */
	public Integer getSex() {
    	return sex;
    }
    /** 性别 */
    public void setSex(Integer sex) {
    	this.sex = sex;
    }
	/** 所属代理商 */
	public Agent getAgent() {
    	return agent;
    }
    /** 所属代理商 */
    public void setAgent(Agent agent) {
    	this.agent = agent;
    }
	/** 创建时间 */
	public Date getCreated() {
    	return created;
    }
    /** 创建时间 */
    public void setCreated(Date created) {
    	this.created = created;
    }
	/** 用户类型 */
	public Integer getType() {
		return type;
	}
	/** 用户类型 */
	public void setType(Integer type) {
		this.type = type;
	}
}
